package com.qq.springbootdemo.repository;

import com.qq.springbootdemo.domain.entity.TransactionEntity;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

// 交易记录仓库接口
public interface TransactionRepository extends JpaRepository<TransactionEntity, Long> {
    List<TransactionEntity> findByFromWalletIdOrToWalletId(Long fromWalletId, Long toWalletId);
    
    default List<TransactionEntity> findByWalletId(Long walletId) {
        return findByFromWalletIdOrToWalletId(walletId, walletId);
    }
}